import { getStatusList as getStatuss } from '@/api/feedback/index'
import {
  getModuleList as getModules,
  getGroupList as getGroups
} from '@/api/system/project'
import { getTagList as getTags } from '@/api/feedback/tagLib'
import { getResultList } from '@/api/feedback/result'

// 模块列表
export function getModuleList (params = {}) {
  return new Promise((resolve, reject) => {
    getModules({
      page_index: 1,
      page_size: 666,
      detail: true,
      ...params
    })
      .then(res => {
        resolve(res.data.list)
      })
      .catch(err => reject(err))
  })
}
export function getTagList (params = {}) {
  return new Promise((resolve, reject) => {
    getTags({
      page_index: 1,
      page_size: 666,
      detail: true,
      ...params
    })
      .then(res => {
        resolve(res.data.list)
      })
      .catch(err => reject(err))
  })
}
// 处理小组
export function getGroupList (params = {}) {
  return new Promise((resolve, reject) => {
    getGroups({
      page_index: 1,
      page_size: 666,
      detail: true,
      ...params
    })
      .then(res => {
        resolve(res.data.list)
      })
      .catch(err => reject(err))
  })
}
// 处理结果
export function getResList (params = {}) {
  return new Promise((resolve, reject) => {
    getResultList({
      page_index: 1,
      page_size: 666,
      detail: true,
      ...params
    })
      .then(res => {
        resolve(res.data.list)
      })
      .catch(err => reject(err))
  })
}
// 反馈状态
export function getStatusList (pro_id) {
  return new Promise((resolve, reject) => {
    getStatuss()
      .then(res => resolve(res.data.list))
      .catch(err => reject(err))
  })
}
